﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace nadModel
{
    public class LogLevelHelper
    {
        public static LogLevel ParseLevel(string lvl)
        {
            if (lvl != null)
            {
                if (lvl.Equals("FATAL", StringComparison.OrdinalIgnoreCase))
                {
                    return LogLevel.FATAL;
                }
                if (lvl.Equals("ERROR", StringComparison.OrdinalIgnoreCase))
                {
                    return LogLevel.ERROR;
                }
                if (lvl.Equals("WARNING", StringComparison.OrdinalIgnoreCase))
                {
                    return LogLevel.WARNING;
                }
                if (lvl.Equals("INFO", StringComparison.OrdinalIgnoreCase))
                {
                    return LogLevel.INFO;
                }
                if (lvl.Equals("DEBUG", StringComparison.OrdinalIgnoreCase))
                {
                    return LogLevel.DEBUG;
                }
            }
            return LogLevel.DEBUG;
        }
    }
}
